package snippets.cse524.activeDates;

public final class WeigthtedActivity implements Comparable<WeigthtedActivity> {
	private final double mentionsRatio;
	private final int numberOfYears;
	private final int beginYear;
	private final int endYear;

	public WeigthtedActivity(double mentionsRatio, int numberOfYears,
			int beginYear, int endYear) {
		super();
		this.mentionsRatio = mentionsRatio;
		this.numberOfYears = numberOfYears;
		this.beginYear = beginYear;
		this.endYear = endYear;
	}

	public double getMentionsRatio() {
		return mentionsRatio;
	}

	public int getNumberOfYears() {
		return numberOfYears;
	}

	public int getBeginYear() {
		return beginYear;
	}

	public int getEndYear() {
		return endYear;
	}

	@Override
	public int compareTo(WeigthtedActivity o) {
		double difference = this.mentionsRatio - o.mentionsRatio;
		if (difference < 0)
			return -1;

		// ignoring equal ratios
		return 1;
	}
}
